package com.hujh.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.hujh.android.ui.GridViewActivity;
import com.hujh.android.ui.UpdateActivity;
import com.hujh.android.ui.tab.MainTabActivity;
import com.hujh.android.ui.tabhost.TabHost2Activity;
import com.hujh.android.ui.tabhost.TabHostActivity;
import com.hujh.android.ui.viewpage.ViewPagerGuideActivity;



public class MainActivity extends Activity {

	private Button btn_viewpager;
	private Button btn_service;
	private Button btn_audio;
	private Button btn_audio_net;
	private Button btn_video;
	private Button btn_listview_scroll;
	private Button btn_handler;
	private Button btn_asynctask;
	private Button btn_toast;
	private Button btn_hosttab;
	private Button btn_update;
	private Button btn_gridview;
	private Button btn_host;
	private Button btn_host2;
	private Button btn_handle_t;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		btn_viewpager = (Button) this.findViewById(R.id.btn_viewpager);
		btn_viewpager.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, ViewPagerGuideActivity.class);
				startActivity(intent);
			}
		});
		
		btn_service = (Button) this.findViewById(R.id.btn_service);
		btn_service.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, ServiceActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_audio = (Button) this.findViewById(R.id.btn_audio);
		btn_audio.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, AudioActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_audio_net = (Button) this.findViewById(R.id.btn_audio_net);
		btn_audio_net.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, AudioNetActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_video = (Button) this.findViewById(R.id.btn_video);
		btn_video.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, VideoActivity.class);
				startActivity(intent);
			}
			
		});
		
		
		
		btn_listview_scroll = (Button) this.findViewById(R.id.btn_listview_scroll);
		btn_listview_scroll.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, ListViewPageActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_handler = (Button) this.findViewById(R.id.btn_handler);
		btn_handler.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, HandlerActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_asynctask = (Button) this.findViewById(R.id.btn_asynctask);
		btn_asynctask.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, AsyncTaskActivity.class);
				startActivity(intent);
			}
			
		});
		
		btn_toast = (Button) this.findViewById(R.id.btn_toast);
		btn_toast.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, ToastActivity.class);
				startActivity(intent);
			}
		});

		btn_hosttab = (Button) this.findViewById(R.id.btn_hosttab);
		btn_hosttab.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, MainTabActivity.class);
				startActivity(intent);
			}
		});
		
		btn_update = (Button) this.findViewById(R.id.btn_update);
		btn_update.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, UpdateActivity.class);
				startActivity(intent);
			}
		});
		
		btn_gridview = (Button) this.findViewById(R.id.btn_gridview);
		btn_gridview.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, GridViewActivity.class);
				startActivity(intent);
			}
		});
		
		btn_host = (Button) this.findViewById(R.id.btn_host);
		btn_host.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, TabHostActivity.class);
				startActivity(intent);
			}
		});
		
		btn_host2 = (Button) this.findViewById(R.id.btn_host2);
		btn_host2.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, TabHost2Activity.class);
				startActivity(intent);
			}
		});
		
		btn_handle_t = (Button) this.findViewById(R.id.btn_handle_t);
		btn_handle_t.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, HandlerThreadActivity.class);
				startActivity(intent);
			}
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
